package sueldos;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.SQLException;



public class ClassTester {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		
		
		
	
		System.out.println(new Utility().fechaParse("01/12/2008"));
		Uatre u = new Uatre();

		//String db = "cameron";
	      System.out.print("Ingrese el periodo: ");//AAAA-MM-DD

	      String periodo = null;
	      try {
	      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
			periodo = br.readLine();
		} catch (IOException e1) {
			e1.printStackTrace();
		}
	 
	      
	      
		String[] j = {"aztiria","clavier","duggan","kenvis","huaicos","tisa","pampa"};
		//String[] j = {"aztiria","clavier","duggan","kenvis","huaicos","tisa","pampa"};
		
		//String[] j = {"pampa"};
		int k = 0;
		while  (k < j.length) {
			ResultSet rs = u.datosUatre(periodo,j[k].toString());
			
			System.out.println(j[k]);
			try {
				while (rs.next()){
					System.out.println("cuil "+rs.getString(1)+" importe: "+rs.getBigDecimal(2).setScale(2, BigDecimal.ROUND_UNNECESSARY));
				}
				
			} catch (SQLException e) {
				e.printStackTrace();
			}
			u.actualizaUatre(u.datosUatre(periodo,j[k].toString()));
			k++;
		}
	}
}
